import org.apache.log4j.DailyRollingFileAppender
import org.apache.log4j.RollingFileAppender

// locations to search for config files that get merged into the main config;
// config files can be ConfigSlurper scripts, Java properties files, or classes
// in the classpath in ConfigSlurper format

// grails.config.locations = [ "classpath:${appName}-config.properties",
//                             "classpath:${appName}-config.groovy",
//                             "file:${userHome}/.grails/${appName}-config.properties",
//                             "file:${userHome}/.grails/${appName}-config.groovy"]

// if (System.properties["${appName}.config.location"]) {
//    grails.config.locations << "file:" + System.properties["${appName}.config.location"]
// }

grails.war.destFile = "SIG.war"
grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
grails.mime.use.accept.header = false
grails.mime.types = [
    all:           '*/*',
    atom:          'application/atom+xml',
    css:           'text/css',
    csv:           'text/csv',
    form:          'application/x-www-form-urlencoded',
    html:          ['text/html','application/xhtml+xml'],
    js:            'text/javascript',
    json:          ['application/json', 'text/json'],
    multipartForm: 'multipart/form-data',
    rss:           'application/rss+xml',
    text:          'text/plain',
    xml:           ['text/xml', 'application/xml']
]

// URL Mapping Cache Max Size, defaults to 5000
//grails.urlmapping.cache.maxsize = 1000

// What URL patterns should be processed by the resources plugin
grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']

// The default codec used to encode data with ${}
grails.views.default.codec = "none" // none, html, base64
grails.views.gsp.encoding = "UTF-8"
grails.converters.encoding = "UTF-8"
// enable Sitemesh preprocessing of GSP pages
grails.views.gsp.sitemesh.preprocess = true
// scaffolding templates configuration
grails.scaffolding.templates.domainSuffix = 'Instance'

// Set to false to use the new Grails 1.2 JSONBuilder in the render method
grails.json.legacy.builder = false
// enabled native2ascii conversion of i18n properties files
grails.enable.native2ascii = true
// packages to include in Spring bean scanning
grails.spring.bean.packages = []
// whether to disable processing of multi part requests
grails.web.disable.multipart=false

// request parameters to mask when logging exceptions
grails.exceptionresolver.params.exclude = ['password']

// configure auto-caching of queries by default (if false you can cache individual queries with 'cache: true')
grails.hibernate.cache.queries = false

environments {
    development {
        grails.logging.jul.usebridge = true
    }
    production {
        grails.logging.jul.usebridge = false
        // TODO: grails.serverURL = "http://www.changeme.com"
    }
}

// log4j configuration
log4j = {
    // Example of changing the log pattern for the default console appender:
    //
    //appenders {
    //    console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
    //}
	info 'grails.app.controller'
	error  'grails.app.controller'
	debug 'grails.app.controller'
	
	appenders {
		console name: 'stdout', layout: pattern(conversionPattern: '%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{2}] %m%n')

		rollingFile name:'errorAppender', file: "log/error.log", append: true,
			layout: pattern(conversionPattern: '%d{yyyy-MM-dd HH:mm:ss} %-5p [%c{2}] %m%n')
	}
	
	error errorAppender:'error', additivity:false
	



//    error  errorAppender 'org.codehaus.groovy.grails.web.servlet'       // controllers
//	error  errorAppender 'org.codehaus.groovy.grails.web.pages'          // GSP
//    error  errorAppender 'org.codehaus.groovy.grails.web.sitemesh'       // layouts
//    error  errorAppender 'org.codehaus.groovy.grails.web.mapping.filter' // URL mapping
//    error  errorAppender 'org.codehaus.groovy.grails.web.mapping'        // URL mapping
//    error  errorAppender 'org.codehaus.groovy.grails.commons'            // core / classloading
//    error  errorAppender 'org.codehaus.groovy.grails.plugins'            // plugins
//	error  errorAppender 'org.codehaus.groovy.grails.orm.hibernate'      // hibernate integration
//	error  errorAppender 'org.springframework'
//	error  errorAppender 'org.hibernate'
//	error  errorAppender 'net.sf.ehcache.hibernate'
}

// Added by the Spring Security Core plugin:
grails.plugins.springsecurity.userLookup.userDomainClassName = 'ar.org.sstuyv.User'
grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'ar.org.sstuyv.UserRole'
grails.plugins.springsecurity.authority.className = 'ar.org.sstuyv.Role'

grails.resources.modules = {
	jqueryb{
		resource url:'/js/jquery-ui-1.10.3/js/jquery-1.9.1.js', disposition: 'head'
	}
	jqueryuib{
		dependsOn 'jqueryb'
		resource url:'/js/jquery-ui-1.10.3/css/smoothness/jquery-ui-1.10.3.custom.min.css', disposition: 'head'
		resource url:'/js/i18n/grid.locale-es.js', disposition: 'head'
		resource url:'/js/jquery-ui-1.10.3/js/jquery-ui-1.10.3.custom.js', disposition: 'head'
	}
	jqgridb{
		dependsOn 'jqueryuib'
		resource url:'/js/jquery.jqGrid-4.5.4/css/ui.jqgrid.css' , disposition: 'head'
		resource url:'/js/jquery.jqGrid-4.5.4/js/jquery.jqGrid.min.js' , disposition: 'head'
		bundle:'app'
	}
	administrador{
		dependsOn 'jqgridb'
		resource url:'/js/sig/ui.comun.js'
		resource url:'/js/sig/administrador.js'
	}
	
	censo{
		dependsOn 'jqgridb'
		resource url:'/js/sig/ui.comun.js'
		resource url:'/js/sig/grillaCenso.js'
		resource url:'/js/sig/grillaBeneficiario.js'
		resource url:'/js/sig/grillaBien.js'
		resource url:'/js/sig/dialogoExpropiaciones.js'
//		resource url:'/js/sig//dialogoNomenclatura.js'
		resource url:'/js/sig/dialogoExpedientes.js'
		resource url:'/js/sig/dialogoNomenclaturaCenso.js'
	}
	
		
	GIS{
		resource url:'/js/resources/openlayers/OpenLayers.js' , disposition: 'head'
	}
	
	
	IIUURegularizacion{
		dependsOn 'jqgridb'
		resource url:'/js/ajaxfileupload.js'
		resource url:'/js/jquery.form.js'
		resource url:'/js/sig/ui.comun.js'
		resource url:'/js/sig/grillaIIUURegularizacion.js'
		resource url:'/js/sig/dialogoExpedientes.js'
		resource url:'/js/sig/dialogoBarrio.js'
		resource url:'/js/sig/dialogoOrigenIURegularizacion.js'
		resource url:'/js/sig/dialogoMotivoIURegularizacion.js'
		resource url:'/js/sig/dialogoEstadoIURegularizacion.js'
	}
	
	planos{
		dependsOn 'jqgridb'
		resource url:'/js/ajaxfileupload.js'
		resource url:'/js/sig/ui.comun.js'
		resource url:'/js/sig/grillaPlanos.js'
		resource url:'/js/sig/dialogoExpropiaciones.js'
//		resource url:'/js/sig/dialogoExpedientes.js'
//		resource url:'/js/sig/dialogoNomenclaturaPlano.js'
//		resource url:'/js/sig/grillaSolicitud.js'
		
	}
	
	InformeTecnicoUrbanistico{
		dependsOn 'jqgridb'
		resource url:'/js/ajaxfileupload.js'
		resource url:'/js/sig/ui.comun.js'
		resource url:'/js/sig/grillaInformeTecnicoUrbanistico.js'
		resource url:'/js/sig/dialogoExpedientes.js'
		resource url:'/js/sig/dialogoNomenclaturaInformeTecnicoUrbanistico.js'
	}
	
	IIUUPrefactibilidad{
		dependsOn 'jqgridb'
		resource url:'/js/ajaxfileupload.js'
		resource url:'/js/sig/ui.comun.js'
		resource url:'/js/sig/grillaNomenclaturaCompleta.js'
		resource url:'/js/sig/toServer.js'
//		resource url:'/js/sig/iiuuPrefactibilidadUrbanistica.js'
		resource url:'/js/sig/grillaPersonal.js'
	}
	
	Barrio{
		dependsOn 'jqgridb, GIS'
		resource url:'/js/sig/ui.comun.js'
		resource url:'/js/sig/grillaBarrios.js'		
		resource url:'/js/sig/dialogDatoDelDominio.js'
		resource url:'/js/resources/ext/adapter/ext/ext-base.js'
		resource url:'/js/resources/ext/ext-all.js'
		resource url:'/js/resources/geoext/build/GeoExt.js'
		resource url:'/js/panel.js'
		resource url:'/js/resources/ext/resources/css/ext-all.css'
//		resource url:'/js/resources/ext/resources/css/xtheme-gray.css'
		resource url:'/js/resources/openlayers/theme/default/style.css'
//		resource url:'/js/resources/geoext/resources/css/gxtheme-gray.css'
	}
	
	InformeUrbanistico{
		dependsOn 'jqgridb'
		resource url:'/js/ajaxfileupload.js'
		resource url:'/js/sig/informeUrbanistico.js'
		resource url:'/js/sig/ui.comun.js'
		resource url:'/js/sig/grillaNomenclaturaCompleta.js'
		resource url:'/js/sig/toServer.js'
		resource url:'/js/sig/grillaPersonal.js'
	}
	
}
